import 'package:flutter/material.dart';

class HomeNav extends StatelessWidget {
  HomeNav({super.key});


  List navList = [
    {'icon': 'assets/images/house_nav_icon@2x.png', 'lable': '我的房屋'},
    {'icon': 'assets/images/repair_nav_icon@2x.png', 'lable': '我的报修'},
    {'icon': 'assets/images/visitor_nav_icon@2x.png', 'lable': '访客登记'}
  ];

  List<Widget> hameNavList() {
    return navList.map((item) {
      return Expanded(
        child: Column(children: [
          Image.asset(
            '${item['icon']}',
            width: 35,
            height: 35,
          ),
          Text('${item['lable']}')
        ]),
      );
    }).toList();
  }

  

  @override
  Widget build(BuildContext context) {
    return Container(
        margin: const EdgeInsets.only(top: 10, bottom: 10),
        padding: const EdgeInsets.only(top: 10, bottom: 10),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(10),
        ),
        child: Row(children: hameNavList()));
  }
}
